#ifndef GROUNDTESTWIDGET_H
#define GROUNDTESTWIDGET_H

#include <QWidget>
#include <QButtonGroup>
#include <QPushButton>
#include <QLabel>
#include <QHBoxLayout>
#include <QLineEdit>
#include "quiqss.h"
#include "define.h"

typedef struct _param
{
    QString sParamName;
    float lfParamMin;
    float lfParamMax;
    float lfCoeff;
    QString sUnit;
}st_param;

typedef struct _workmodeParam
{
    QString sName;
    int paramCnt;
    st_param param1;
    st_param param2;
}st_workmodeParam;



class QGroundTestWidget : public QWidget
{
    Q_OBJECT
public:
    explicit QGroundTestWidget(QWidget *parent = nullptr);

    void InitUI();

    QWidget* createParamWidget();

    void setParamInfo();

    void setButtonStyleSheet(QPushButton* pBtn);

    void setHBoxHide(QString sObjectName,bool bHid);

    void setButtonGroupEnable(bool benable);

    void sendParamData();

signals:

    void signal_startTest(int i32Axis,int workmode,int data,int data1);

public slots:
    void onAxisChange(int Index);
    void onWorkModeChange(int Index);
    void onStartTest();

    void StopTest();


private:
    QButtonGroup* _pAxisBtnGroup;
    QButtonGroup* _pWorkModeBtnGroup;

    QLabel* _pParamNameLabel[4];
    QLineEdit* _pParamEdit[4];
    QPushButton* _pStartTestBtn;

    QMap<int,st_workmodeParam> _workModeParamMap;

    int _i32AxisSelect;

    int _i32CurrentWorkMode;

};

#endif // GROUNDTESTWIDGET_H
